<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
    <title>具名插槽</title>
</head>
<body>
<div id="app">
    <navigation-link>
        <template #header>
            <h1>这是头部</h1>
        </template>

        <template #main>
            <h2>这是内容</h1>
        </template>

        <template #footer>
            <h3>这是尾部</h3>
        </template>
    </navigation-link>
    
</div>

<script>
     Vue.component('navigation-link', {
        template: `
           <div>
                <header>
                    <!-- 我们希望把页头放这里 -->
                    <slot name="header"></slot>
                </header>
                <main>
                    <!-- 我们希望把主要内容放这里 -->
                    <slot name="main"></slot>
                </main>
                <footer>
                    <!-- 我们希望把页脚放这里 -->
                    <slot name="footer"></slot>
                </footer>
           </div>
        `
    })
    new Vue({
        el: '#app',
        data: function (){
            return {
                user: {
                  name: 'lican'
                }
            }
        }
    })


</script>
</body>
</html>